KAAV-2363 Muokkausnäkymän aikajanan pituudet poikkeavat Gantt-aikajanan pituuksista#657
Open
henrihaapalasiili wants to merge 7 commits intodevelopmentfrom
Open
KAAV-2363 Muokkausnäkymän aikajanan pituudet poikkeavat Gantt-aikajanan pituuksista#657henrihaapalasiili wants to merge 7 commits intodevelopmentfrom
henrihaapalasiili wants to merge 7 commits intodevelopmentfrom
Conversation
…rrides API deadlines with attribute_data dates and resizes the grid to true week counts. Changed helpers/createDeadlines.js to build week metadata from provided months so milestones stay aligned. helpers/createMonths.js keeps a 13-month window starting one month back with per-month week counts. helpers/helpers.js now computes findInMonths/findWeek from real dates to stay in sync with the metadata grid.
…range Problem: Timeline was showing wrong phase color (e.g., Käynnistys green instead of Ehdotus red) when the visible date range contained no phase_start or phase_end markers. This happened because: 1. createStartAndEndPoints blindly placed phase markers if their date mapped to a visible slot, ignoring whether the phase was actually valid/active during that time 2. The fallback logic in fillGaps iterated deadlines sequentially and picked the last phase_start before visible range, which was often the wrong phase Solution: Added three new helper functions: - getSlotDate(): Computes actual calendar date for a timeline slot - buildPhaseTimeline(): Pre-processes deadlines to build a map of each phase's effective start/end dates (earliest start, latest end) - findActivePhaseAtDate(): Determines which phase is active at a given date by checking start <= date <= end Key changes in createStartAndEndPoints: - Compute visible date range from inputMonths - Build phase timeline and filter to only phases that overlap with visible range AND have valid dates (start <= end) - Skip phases with invalid date ordering (e.g., start > end) - Skip individual deadlines whose dates fall outside visible range Key changes in fillGaps: - Replaced old sequential deadline iteration with proper phase lookup - Uses findActivePhaseAtDate to find the correct active phase at visible start date, ensuring correct color is displayed
- Only apply 'first' rounded corners when phase actually starts (phase_start) or there's a real color transition (previous slot had different color) - Only apply 'last' rounded corners when phase actually ends (phase_end) or there's a real color transition (next slot has different color) - Phases continuing from before visible range (past_start_point) no longer get incorrect rounded left corners - Phases continuing beyond visible range no longer get incorrect rounded right corners - Fixed inner milestone width to use 100% for middle segments - Added gap: 0 to timeline grid container
Bug: When a phase_end (e.g. Käynnistys K2) landed exactly on the first visible week of the timeline, the has_endpoint_in_range flag was not being set in the else branch of fillGaps() (for slots with 4+ keys). This caused the code to incorrectly fall into the 'no endpoints in range' special case, overwriting the entire timeline with the wrong phase color. Fix: Set has_endpoint_in_range = true in both branches of the fillGaps loop when a deadline_type array is detected, ensuring proper detection regardless of the number of keys in the slot.
Check for deadline errors (is_under_min_distance_next, is_under_min_distance_previous, out_of_sync) on ALL deadlines before filtering. Previously, if a deadline with errors was filtered out (not visible), the error message 'Projekti ei ole ajan tasalla' would not display.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



-Align ProjectTimeline and VisTimline.
-ProjectTimeline.jsx overrides API deadlines with attribute_data dates and resizes the grid to true week counts.
-Changed helpers/createDeadlines.js to build week metadata from provided months so milestones stay aligned.
-helpers/createMonths.js keeps a 13-month window starting one month back with per-month week counts.
-helpers/helpers.js now computes findInMonths/findWeek from real dates to stay in sync with the metadata grid.
-Timeutil date compare fix.
-Timeutil unit tests fix.
Problem:
Timeline was showing wrong phase color (e.g., Käynnistys green instead of
Ehdotus red) when the visible date range contained no phase_start or
phase_end markers. This happened because:
mapped to a visible slot, ignoring whether the phase was actually
valid/active during that time
picked the last phase_start before visible range, which was often
the wrong phase
Solution:
Added three new helper functions:
phase's effective start/end dates (earliest start, latest end)
date by checking start <= date <= end
Key changes in createStartAndEndPoints:
visible range AND have valid dates (start <= end)
Key changes in fillGaps:
visible start date, ensuring correct color is displayed"
-Fixed rounding corners in timeline, texts to show up correct place and no gaps in white lines.
-When a phase_end (e.g. Käynnistys K2) landed exactly on the first
visible week of the timeline, the has_endpoint_in_range flag was not
being set in the else branch of fillGaps() (for slots with 4+ keys).